In a data processing system including a host cluster and a plurality of storage arrays, if data migration is performed between a new storage array (which is referred to as a first storage array in the following) and an original storage array (which is referred to as a second storage array in the following), the following steps need to be performed in a preparation phase of the data migration, mapping a to-be-migrated logical unit (also referred to as LU) of the second storage array to the first storage array in an LU number (LUN) mapping manner, establishing a virtual LU in the first storage array, and establishing a correspondence between the to-be-migrated LU and the virtual LU, and after the to-be-migrated LU is mapped to a host using the first storage array, the host may obtain, using multipath software, a plurality of paths that are used to access the to-be-migrated LU. Paths may be divided into two types, a first type of path is a path used to directly connect the host to the second storage array, and a second type of path is a path used to connect the host to the second storage array using the first storage array.
When different hosts (for example, a host A and a host B) perform an input/output (I/O) operation on the to-be-migrated LU, if a split-brain phenomenon (for example, communication interruption) occurs between the host A and the host B, the host A and the host B may send a reservation preemption command to the second storage array to seize control of the to-be-migrated LU. In a preemption process, if the host A sends a reservation preemption command to the second storage array, and the host B sends a reservation preemption command to the second storage array using the first storage array, the second storage array receives the reservation preemption command sent by the host A such that the host A preempts the to-be-migrated LU. The first storage array receives the reservation preemption command sent by the host B. If the reservation preemption command is forwarded in an original state to the second storage array, because the second storage array identifies a source of the reservation preemption command based on a delivery port of the first storage array, the second storage array may not implement preemption performed by the host B on the to-be-migrated LU. In addition, the first storage array may implement, based on the reservation preemption command, preemption performed by the host B on the virtual LU in the first storage array. If the two hosts succeed in preemption, when the data migration is performed subsequently, because the to-be-migrated LU and the virtual LU are occupied by different hosts, data in the virtual LU cannot be consistent with data in the to-be-migrated LU when a command of the host A is inconsistent with a command of the host B. Consequently, data in the original storage array cannot be consistent with data in the new storage array.
To ensure consistency of data, an existing reservation preemption method is generally as follows. The first storage array may use an N_Port_ID virtualization (NPIV) function and use a port of the first storage array to perform one-to-one simulation on host ports of each host. As shown in FIG. 1, a world wide name (WWN) of a P10′ of the first storage array (designated as storage array D) is set to the WWN of the P10, and a WWN of a P11′ is set to the WWN of the P11 of host A. When the first storage array receives a command from a P00 port, the first storage array selects the P10′ corresponding to the P10, and forwards, using the P10′, the reservation preemption command in an original state to the second storage array (designated as storage array C). The second storage array may determine, based on the WWN of the P10′ (that is, the WWN of the P10), that the source of the reservation preemption command is the host A, and then performs an operation of preempting the to-be-migrated LU by the host A.
However, in other approaches, an NPIV technology needs to be implemented based on a Fiber Channel (also referred to as FC) switch. In a networking scenario without the FC switch, the foregoing reservation preemption method cannot be implemented and has a great limitation.